<?php
function smarty_modifier_cleanhtml($document){
	$document = stripslashes($document);
	$junk = 'style|STYLE|class|CLASS|align|ALIGN';
	$search = array('@<script[^>]*?'.'>.*?</script>@si',  // Strip out javascript
				'@<style[^>]*?'.'>.*?</style>@siU',    // Strip style tags properly
				//'@<[\/\!]*?[^<>]*?'.'>@si',            // Strip out HTML tags
				'@<![\s\S]*?--[ \t\n\r]*>@'       // Strip multi-line comments including CDATA
				//'/([\s]+)('.$junk.')([\s]*)=([\s]*)(("|\’)([^"\']+)("|\’)|([^>"\']+))*/' // atrybuty style|STYLE|class|CLASS|align|ALIGN
			);
	$text = preg_replace($search, '', $document);
  return $text;
}


?>
